package com.ssy.lingxi.logistics.entity;

import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 运费模板实体类
 *
 * @author yzc
 * @version 2.0.0
 * @date 2020/7/14
 */
@Data
@Entity
@Table(schema = "public", name = "ls_logistics_freight_template",
        indexes = {@Index(name = "ls_logistics_freight_template_member_id_idx", columnList = "memberId"),
                @Index(name = "ls_logistics_freight_template_role_id_idx", columnList = "roleId")})
public class FreightTemplate implements Serializable {

    private static final long serialVersionUID = 1908899268568870376L;

    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "logistics_freight_template_seq")
    @SequenceGenerator(sequenceName = "ls_logistics_freight_template_seq", name = "logistics_freight_template_seq", allocationSize = 1)
    private Long id;

    /**
     * 模板名称
     */
    @Column(columnDefinition = "varchar(30)")
    private String name;

    /**
     * 计价方式 1-按重量
     */
    @Column
    private Integer pricingMode;

    /**
     * 运送方式 1-快递
     */
    @Column
    private Integer transportMode;

    /**
     * 重量(KG)
     */
    @Column
    private Double weight;

    /**
     * 价格(元)
     */
    @Column
    private BigDecimal price;

    /**
     * 每增加重量(KG)
     */
    @Column
    private Double incrementWeight;

    /**
     * 每增加价格(元)
     */
    @Column
    private BigDecimal incrementPrice;

    /**
     * 运费说明
     */
    @Column(columnDefinition = "varchar(60)")
    private String explain;

    /**
     * 状态 0-无效 1-有效
     */
    @Column
    private Integer status;

    /**
     * 数据关联会员id
     */
    @Column
    private Long memberId;

    /**
     * 数据关联角色id
     */
    @Column
    private Long roleId;

    /**
     * 创建时间
     */
    @Column
    private Long createTime;
}
